package com.hotel.controller;

import com.hotel.mapper.RoomMapper;
import com.hotel.pojo.Room;
import com.hotel.service.RoomService;
import com.hotel.utils.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author YanMin
 * @version 1.0
 * @description:
 * @since 2022/8/16 23:57
 */
@RestController
@RequestMapping("/room")
public class RoomController {

    @Autowired
    private RoomService roomService;

    //查询
    @RequestMapping("/selectRoom")
    public ResultInfo selectRoom(String roomId, int page, int size) {
        return roomService.selectRoom(roomId, page, size);
    }

    //删除
    @RequestMapping("/deleteRoomByRoomId")
    public ResultInfo deleteRoomByRoomId(Integer roomId) {
        return roomService.deleteRoomByRoomId(roomId);
    }

    //修改
    @RequestMapping("/updateRoomByRoomId")
    public ResultInfo updateRoomByRoomId(Room room) {
        return roomService.updateRoomByRoomId(room);
    }
    //增加
    @RequestMapping("/insertRoom")
    public ResultInfo insertRoom(Room room){
        return roomService.insertRoom(room);
    }

}
